//
//  WKMineListCell.m
//  WKMaybell
//
//  Created by 何文虎 on 2019/1/2.
//  Copyright © 2019 何文虎. All rights reserved.
//

#import "WKMineListCell.h"

@interface WKMineListCell ()
@property(nonatomic,strong)UIImageView *iconView;

@end

@implementation WKMineListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self layoutineListCell];
    }
    return self;
}

- (void)layoutineListCell{
    
    [self.contentView addSubview:self.iconView];
    [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(14);
        make.size.mas_equalTo(CGSizeMake(20, 20));
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
    }];
    
    [self.contentView addSubview:self.titleLb];
    [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.iconView.mas_right).offset(11);
        make.size.mas_equalTo(CGSizeMake(150, 14));
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
    }];
    
    [self.contentView addSubview:self.detailLb];
    [self.detailLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-12);
        make.size.mas_equalTo(CGSizeMake(150, 14));
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
    }];
    
    _iconView.backgroundColor = [UIColor redColor];
}

- (UIImageView*)iconView{
    if (!_iconView) {
        _iconView = [[UIImageView alloc]init];
    }
    return _iconView;
}

- (UILabel*)titleLb{
    if (!_titleLb) {
        _titleLb = [[UILabel alloc]init];
        _titleLb.font = PFSC_MediumFont(12);
        _titleLb.textColor = UIColorFromHex(0x3C3C3C);
        _titleLb.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLb;
}

- (UILabel*)detailLb{
    if (!_detailLb) {
        _detailLb = [[UILabel alloc]init];
        _detailLb.font = PFSC_MediumFont(12);
        _detailLb.textColor = UIColorFromHex(0x979797);
        _detailLb.textAlignment = NSTextAlignmentRight;
    }
    return _detailLb;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
